package com.lin.forum.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;
@Data
@Schema(description ="用户信息表")
public class User {
    @Schema(description ="用户id，主键，⾃增")
    private Integer id;

    @Schema(description ="用户名，⾮空，唯⼀")
    private String username;

    @Schema(description ="加密后的密码")
    @JsonIgnore //不参与JSON序列号
    private String password;

    @Schema(description ="昵称，⾮空")
    private String nickname;

    @Schema(description ="⼿机号")
    private String phoneNum;

    @Schema(description ="邮箱地址")
    private String email;

    @Schema(description ="0⼥ 1男 2保密，⾮空，默认2")
    private Byte gender;

    @JsonIgnore //不参与JSON序列号
    @Schema(description ="为密码加盐，⾮空")
    private String salt;

    @Schema(description ="⽤⼾头像URL，默认系统图⽚")
    private String avatarUrl;

    @Schema(description ="发帖数量，⾮空，默认0")
    private Integer articleCount;

    @Schema(description ="是否管理员，0否 1是，默认0")
    private Byte isAdmin;

    @Schema(description ="备注，⾃我介绍")
    private String remark;

    @Schema(description ="状态 0 正常，1 禁⾔，默认0")
    private Byte state;

    @JsonIgnore //不参与JSON序列号
    @Schema(description ="是否删除 0否 1是，默认0")
    private Byte deleteState;

    @Schema(description ="创建时间，自动记录插入时间")
    private Date createTime;

    @Schema(description ="修改时间，自动更新")
    private Date updateTime;

}